package com.yhp.service.impl;

import com.yhp.bean.Student;
import com.yhp.dao.impl.StudentDaoImple;

import java.util.List;

public class StudentService {
    /***
     * 获取学生信息
     * @param name
     * @param stuno
     * @param sex
     * @param pageIndex
     * @param pageSize
     * @return
     */
    public static List<Student> getstudent(String name,String stuno,int sex,int pageIndex,int pageSize){
        return new StudentDaoImple().getStudents(name,stuno,sex,pageIndex,pageSize);
    }

    /***
     * 获取信息总长度
     * @param name
     * @param stuno
     * @param sex
     * @return
     */
   public static int total(String name,String stuno,int sex){
        return new StudentDaoImple().total(name,stuno,sex);
   }
    /***
     * 存入信息
     */
    public static int addStudent(Student student){
        return new StudentDaoImple().addStudent(student);
    }
    /***
     * 通过id获取信息
     */
    public static Student findStudent(int id){
        return new StudentDaoImple().findStudent(id);
    }
    /**
     * 更新数据
     */
    public static int upDate(Student student){
        return new StudentDaoImple().upDate(student);
    }

    /**
     * 删除学生信息
     * @param id
     * @return
     */
    public static int deletStudent(int id){
        return new StudentDaoImple().deleteStudent(id);
    }
}
